package cn.kgc.spring.entity;

/**
 * @author 课工场
 * @date 2024/11/5
 * @description
 */

public class Student {

    private Integer id;
    private String stuName;
    private Integer age;

    public Student() {
        System.out.println("------------Student()--------------");
    }

    public Student(Integer id, String stuName, Integer age) {
        this.id = id;
        this.stuName = stuName;
        this.age = age;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        System.out.println("-----------set()------------");
        this.id = id;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }


    // bean销毁前自动调用的销毁方法
    public void   destroy(){
        System.out.println("-------------destroy()--------------");
    }


    // init
    public void  init(){
        System.out.println("-------------init()--------------");
    }
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", stuName='" + stuName + '\'' +
                ", age=" + age +
                '}';
    }
}
